package letterbox;

import java.awt.Point;

/**
 * @author Mikael Kohlmyr
 */
public class Cell{
    public static final int WIDTH = 28;
    public static final int HEIGHT = 28;
    private Point position;
    private char answer;
    private char given;

    public Cell(char answer, int x, int y){
        this.answer = answer;
        this.position = new Point(x,y);
    }

    public char getAnswer() {
        return answer;
    }

    public char getGiven() {
        return given;
    }

    public void setGiven(char given) {
        this.given = given;
    }

    public int getX() {
        return position.x;
    }

    public int getY() {
        return position.y;
    }

    @Override
    public boolean equals(Object o) {
        if(o instanceof Cell){
            return (o.hashCode() == this.hashCode());
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 59 * hash + (this.position != null ? this.position.hashCode() : 0);
        hash = 59 * hash + this.answer;
        return hash;
    }
}
